import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';

import {Observable} from "rxjs/Observable";
import 'rxjs/add/operator/map';


@Injectable()
export class MemberPerformanceProvider {

    constructor(public http: HttpClient) {
    }

    data = [
        {
            'agentCode': '1',
            'agentName': '营业员',
            'agentLevel': 'SMD',
            'yearPc': '0',
            'topPc': '0',
            'pcGap': '0',//净pc差距
            'yearLifeInsurance': '0',
            'topLifeInsurance': '0',
            'lifeInsGap': '0'
        },
        {
            'agentCode': '1',
            'agentName': '营业员',
            'agentLevel': 'SMD',
            'yearPc': '0',
            'topPc': '0',
            'pcGap': '0',//净pc差距
            'yearLifeInsurance': '0',
            'topLifeInsurance': '0',
            'lifeInsGap': '0'
        }, {
            'agentCode': '1',
            'agentName': '营业员',
            'agentLevel': 'SMD',
            'yearPc': '0',
            'topPc': '0',
            'pcGap': '0',//净pc差距
            'yearLifeInsurance': '0',
            'topLifeInsurance': '0',
            'lifeInsGap': '0'
        }, {
            'agentCode': '1',
            'agentName': '营业员',
            'agentLevel': 'SMD',
            'yearPc': '0',
            'topPc': '0',
            'pcGap': '0',//净pc差距
            'yearLifeInsurance': '0',
            'topLifeInsurance': '0',
            'lifeInsGap': '0'
        }, {
            'agentCode': '1',
            'agentName': '营业员',
            'agentLevel': 'SMD',
            'yearPc': '0',
            'topPc': '0',
            'pcGap': '0',//净pc差距
            'yearLifeInsurance': '0',
            'topLifeInsurance': '0',
            'lifeInsGap': '0'
        },

    ];

    /**
     * 获取团队成员历史业绩
     * @returns {Observable<any>}
     */
    getMenberPer(parms): Observable<any> {

        // return Observable.create(o => {
        //     o.next(this.data);
        // })
     return this.http.get(`/achieve/v1/groupSingleTeamHistoryAchieve?groupId=${parms.groupId}`);
    }
}
